<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<script type="text/javascript">
 $(function(){
	 var consumerPoint=${sessionScope.cvo.point};
	 var productPrice=${requestScope.map.totalPrice};
	 $("#result").html(consumerPoint-productPrice);
	 $("#buyBtn").click(function(){
		 if(consumerPoint<productPrice){
			 alert("포인트가 부족합니다.");
			 location.href="${initParam.root }/purchasePointView.do";
			 return false;
		 }
		location.href="buyProduct.do?productId=${requestScope.map.pvo.productId}&productName=${requestScope.map.pvo.productName}"+
				"&productPrice=${requestScope.map.pvo.productPrice}&sellerId=${requestScope.map.pvo.sellerId}"+
				"&amount=${requestScope.map.amount}&id=${sessionScope.cvo.id}&point=${requestScope.map.totalPrice}"; 
	 });
 });
</script>
<style>
 #chargeTable{
  background: white;
  width:200;

 }
</style>
 <hr>


	나의 포인트 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${sessionScope.cvo.point}<br><br>
	상품 판매가 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img  src="${initParam.root }/img/-.png" width="30" height="30">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${requestScope.map.totalPrice}<br>
	------------------------------------------<br>
	최종결제금액&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img  src="${initParam.root }/img/=.png" width="30" height="30">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span id="result"></span><br>
<br>
<input type="button" value="구매확정" id="buyBtn">


